<?
// 출력 파일
$file_name = $_POST['excel_file'];
$target_file = $_SERVER['DOCUMENT_ROOT'] . "/assets/xls/" . $file_name;

$file_len = filesize($target_file);

//Begin writing headers
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: application/vnd.ms-excel");

$header = "Content-Disposition: attachment; filename=" . $file_name . ";"; 
header($header);
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $file_len);

@readfile($target_file);
@unlink($target_file);
exit();
?>